import React, { Component } from "react";
import { observer } from "mobx-react";
export interface AddCountProps {
  store: any;
}

export interface AddCountState {}
@observer
class AddCount extends Component<AddCountProps, AddCountState> {
  render() {
    return (
      <>
        Counter:{this.props.store.count}
        <button onClick={this.handleDec}>+</button>
        <button onClick={this.handleInc}>-</button>
      </>
    );
  }
  handleDec = () => {
    this.props.store.decrement();
    this.forceUpdate();
  };
  handleInc = () => {
    this.props.store.increment();
    this.forceUpdate();
  };
}

export default AddCount;
